In the OT, "the" Satan was an opposer. In Job it was a son of God who carried out YHWH's instructions and was limited to that action. He would be something like a Public Prosecutor.
The word :"devil" comes to us from the Septuagint -- the Greek translation of the Hebrew scriptures, where they used the word "Diabolos" which became Devil.
When the 3rd century BCE Jews (and more particularly the common class) used their creative imagination (and ideas from their neighbours) they invented a spirit world along with an evil class of spirits, a war within heaven, and a Leader of the angles they invented as having "fallen". This Leader was given a range of names, the most popular being Mastema (see Jubilees), Azazel, Beliar, Belial, Beelzeboul, Satan, and so forth, depending on the region where he resided. Later on, closer to the time of the NT, they invented daemons (demons), which influence carried over to Christianity (another Jewish sect) and to Islam.
https://jwstudies.com/2TP_A_Spirit_World.pdf
https://jwstudies.com/Revolutions_Satan__Lucifer__Devil.pdf
Doug